﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PreeRegisterBLL.Security
{
    public class Caltoken
    {
        /// <summary>
        /// 获取MD5加密后的token
        /// </summary>
        /// <param name="Encryptkey"></param>
        /// <param name="fromtype"></param>
        /// <param name="timestamp"></param>
        /// <returns></returns>
        public static string GetToken(string Encryptkey, string fromtype, string timestamp)
        {
            try
            {
                string strToken = Encryptkey + fromtype + timestamp;
                return MD5.myMD5(strToken);
            }
            catch (Exception err)
            {
                
                throw;
            }
        }

        /// <summary>
        /// 获取MD5加密后的token_简单
        /// </summary>
        /// <param name="Encryptkey"></param>
        /// <returns></returns>
        public static string GetToken_Sample(string Encryptkey, string timestamp)
        {
            try
            {
                string strToken = Encryptkey + timestamp;
                return MD5.myMD5(strToken);
            }
            catch (Exception err)
            {

                throw;
            }
        }
    }
}
